Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Article: Python Function ID #962

Merged
merged 3 commits into from
May 17, 2016
Merged

Article: Python Function ID #962

merged 3 commits into from
May 17, 2016

Conversation

dotgourav
Copy link
Contributor

For issue #819

@ghost ghost changed the title Added Python-Function-ID.md Article: Python Function ID May 15, 2016
@ghost ghost assigned alayek May 15, 2016
@ghost ghost added this to the June Summit milestone May 15, 2016
@ghost ghost added QA Python labels May 15, 2016
## Return Value

The return value would be a unique and constant `integer`.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate line can be removed.

converted object heading to  h4 and removed duplicate line about return value.
@dotgourav
Copy link
Contributor Author

@theflametrooper I've implemented the changes. Could you check if that is what you suggested?


## Argument

#### object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-#### object
+### object

@Rafase282
Copy link
Member

I made some changes, there was no reason to go for h4 after a h2.

@dotgourav
Copy link
Contributor Author

Thanks @Rafase282 . What else is required for this PR to be accepted?

@Rafase282
Copy link
Member

From me, just that.

@@ -0,0 +1,42 @@
# Python id(object)

`id()` is a built-in function in Python 3, which returns the *identity* of an object. The *identity* is a unique integer for that object during its lifetime. In CPython implementation, this is the address of the object in memory which is not necessarily true for other python implementations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CPython implementation

A beginner would want to know what you mean by CPython implementation, so better link to the GitHub mirror of CPython interpreter, or some article that talks about this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is not necessarily true for other python implementations.

I know that CPython is not a perform-ant implementation. PyPy and Pyston would probably handle performance better by moving around objects in memory.

But reading it, it feels like that id() need to be same, is not part of the spec. Is that so? I am not fully aware of this.

@alayek
Copy link
Member

alayek commented May 16, 2016

Thanks for the article @gouravchawla ! Great job 👍

I don't come across people often who care about underlying implementation details of a language. Just fix as per the comments on the article, and we are ready to merge.

The different python implementation details are confusing and could be ignored. The id() function is not used that much so omitting the statement makes more sense.
@dotgourav
Copy link
Contributor Author

Thanks @alayek . Also, I've made some changes and I think omitting the details about implementation makes more sense as the id() function is not used that much. Even the official documentation doesn't say much about it.

@Rafase282
Copy link
Member

LGTM 👍

@alayek alayek merged commit 342b8f2 into freeCodeCamp:master May 17, 2016
@BerkeleyTrue BerkeleyTrue removed the QA label May 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants